/**
*	@file    \B\1.cpp
*	@date    2013-10-5 17:15
*	@author  Il'yas Garipov <logirz728@gmail.com>
*
*	Sub-square division finder.
*
*	@version 1.0.1
*
*	@par The single number N is entered
*	@par If N has an exact square as one of its divisors, YES is printed.
*	@par Else, the program prints NO.
*/

#include <stdio.h>
#include <math.h>
#include <assert.h>

#define LL_t long long int //!< To simplify naming a bit

#ifndef NDEBUG
	#define DOUT( toprint ) printf( "\n# " toprint )	//!< Debug output, prints a plain text line preceded by #
	#define DPUT( toput , x ) printf( "\n# " toput , x )//!< Debug put, a DOUT with a single variable inside
	#define DLN											//!< Debug line, doesn't exist in release (with NDEBUG defined)
	#define DPUTCLOSURE	DOUT("=============================================================================");\
						DPUT("FILE: %s", __FILE__ );\
						DPUT("COMPILATION DATE: %s", __DATE__ );\
						DPUT("COMPILATION TIME: %s", __TIME__ )//!< Put a closing statement, complete with datestamp and finename.
#else
	#define DOUT
	#define DPUT
	#define DLN if(0)
	#define DPUTCLOSURE
#endif


int main()
{
	DOUT("=======================2007, 1 semester assignment, 1-B=======================\n");
	DOUT("==============================================================================\n");
	DOUT("Please enter a natural number which will be tested on having a square divider:\n");
	DOUT("> ");
  
	LL_t n = 0;
	int chk = scanf("%lld", &n);
	DLN assert(("You have entered a single number" , chk == 1));
   
	bool ok = 0 ;//for some reason it doesn't integrate in the for loop
	for(LL_t i = 2; i <= sqrt(n); i++) {
		if(  !(n%i) && !( n%(i*i) )  ) {
			ok = 1;
			
			DPUT("The squared divisor we found is %lld\n", (i*i));
			
			break;
		}
	}

	printf (ok? "YES" : "NO");
	
	DPUTCLOSURE;

	return 0;
}
